When I try to display the html file HostingEnvironment.MapPath I got the error. There was a problem with my code and got
an exception message as,
An exception of type 'System.ArgumentException' occurred in System.Web.dll but was not handled in user code
Additional information: The relative virtual path '../Data/page.html' is not allowed here.
Solution:
Instead of passing the path '../Data/page.html' we should use path like this,
System.Web.Hosting.HostingEnvironment.MapPath("~/Data/" + md)
Post your comments / questions
Recent Article
- How to hide the ID field from the Django admin?
- It is impossible to add a non nullable field without specifying a default. Django error
- ImportError: cannot import name 'url' from 'django.conf.urls' - Django Error
- How to Enable Virtualization in BIOS Security Settings in Intel Processors For Android Studio?
- Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it.
- AttributeError: 'NoneType' object has no attribute 'get_text' - Python
- ModuleNotFoundError: No module named 'openpyxl' - Python
- How to get thumbnail from vimeo video URL in Python?
Related Article